Skip to content

Fix parent ID parsing to handle # prefix in issue references#7938

Merged
pelikhan merged 2 commits intomainfrom
copilot/fix-parent-id-mapping
Dec 28, 2025
Merged

Fix parent ID parsing to handle # prefix in issue references#7938
pelikhan merged 2 commits intomainfrom
copilot/fix-parent-id-mapping

Conversation

Copy link
Contributor

Copilot AI commented Dec 28, 2025

The plan.md workflow failed when creating sub-issues from issue comments because parseInt("#123", 10) returns NaN when the parent field contains GitHub's standard issue reference format with a # prefix.

Changes

  • actions/setup/js/create_issue.cjs: Strip # prefix before parsing parent issue numbers
  • actions/setup/js/create_issue.test.cjs: Add test coverage for all parent field formats

Example

// Before: Failed on "#123"
effectiveParentIssueNumber = parseInt(String(createIssueItem.parent), 10);

// After: Handles "#123", "123", and 123
const parentStr = String(createIssueItem.parent).trim();
const parentWithoutHash = parentStr.startsWith('#') ? parentStr.substring(1) : parentStr;
effectiveParentIssueNumber = parseInt(parentWithoutHash, 10);

The fix ensures parent-child issue relationships work correctly whether the parent is specified as a temporary ID ("aw_abc123def456"), a number with hash ("#123"), a string number ("123"), or an integer (123).

Original prompt

Reference: https://github.com/githubnext/gh-aw/actions/runs/20544320401/job/59012908170#step:6:1

The parent id should have been mapped to the issue id using the temporary id mapping.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Dec 28, 2025
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix parent ID mapping to issue ID using temporary ID mapping Fix parent ID parsing to handle # prefix in issue references Dec 28, 2025
Copilot AI requested a review from pelikhan December 28, 2025 02:20
@pelikhan pelikhan marked this pull request as ready for review December 28, 2025 02:22
@pelikhan pelikhan merged commit ca5d7d4 into main Dec 28, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/fix-parent-id-mapping branch December 28, 2025 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants